﻿@model IEnumerable<HanGu.Entity.Library>
@{
    ViewBag.Title = "汉古书院";
    Layout = "~/Views/Shared/Main.cshtml";
    TempData["sidecalss"] = "EveryDayWisdom";
    var SearchParma = ViewData["SearchParma"] as HanGu.Entity.UniversallySearchParam ?? new HanGu.Entity.UniversallySearchParam();

}
@section Header
{
    <style>
        .contentLeft
        {
            width: 100%;
        }
        #partContent
        {
            width: 100%;
        }
        .movieContain
        {
            width: 100%;
            margin-top: 5px;
        }
        .ContentTitleRight
        {
            width: 300px;
        }
        .EducationTitle
        {
            width: 100%;
        }
        .EducationTitle table
        {
            width: 480px;
        }
        .titleleft
        {
            width: 80%;
            font-weight: bold;
        }
        .titleright
        {
            text-align: right;
            width: 20%;
        }
    </style>
}
@section Banner
{
    @Html.Partial("Banner")
}
@section Content{
    <form id="LibrarypagerForm" method="post" action="/Flibrary/index">
    <input type="hidden" name="pageNum" value="@SearchParma.Pagination.CurrentIndex" />
    <input type="hidden" name="PageTotal" value="@SearchParma.Pagination.PageTotal" />
    <input type="hidden" name="RowCount" value="@SearchParma.Pagination.RowCount" />
    <input type="hidden" name="orderField" value="${param.orderField}" />
    <input type="hidden" name="Title" value="@SearchParma.Ttile" />
    <input type="hidden" name="StarTime" value="@SearchParma.StarDateTime" />
    <input type="hidden" name="EndTime" value="@SearchParma.EndDateTime" />
    </form>
    <div class="contentLeft">
        <table cellpadding="0" cellspacing="0" id="partContent">
            <tr>
                <td>
                    <div class="ContentTitle">
                        <div class="ContentTitleLeft">
                            <img src="/Content/images/libraryTitle.gif" width="145" height="26" alt=""></div>
                        <div class="ContentTitleRight" style="padding-top: 0px">
                            <input type="text" name="key" class="textInput focus" value="@SearchParma.Ttile" />
                            <input type="button" class="buttonContent" value="搜索" onclick="Search()" />
                            <script>
                                function Search() {
                                    var pageform = $('#@ViewData["pageform"]');
                                    var keyVal = $("input[name='key']").val();
                                    $("input[name='Title']", pageform).val(keyVal);
                                    $("input[name='pageNum']", pageform).val(1);
                                    pageform.submit();

                                }
                            </script>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="content">
                    <div class="detail">
                        @TempData["ModuleDetail"]
                    </div>
                    <div class="clear">
                    </div>
                    <div class="Educationlist">
                        @foreach (var item in Model)
                        {
                            <div class="movieContain">
                                <div class="parent_panel">
                                    <div class="movie_image_panel">
                                        @{
                            var titlePic = string.Empty;
                            if (!string.IsNullOrEmpty(item.TitlePic))
                            { titlePic = item.TitlePic.Replace("_B", "_S"); }
                            else
                            { titlePic = "/Content/default.jpg"; } 
                                        }
                                        <a href="/flibrary/detail/@item.ID">
                                            <img src="@titlePic" alt="@item.Title" style="height:80px; width:150px;"/></a>
                                    </div>
                                    <div class="movie_text_panel">
                                        <ul>
                                            <li class="EducationTitle">
                                                <table>
                                                    <tr>
                                                        <td class="titleleft">
                                                            <a href="/flibrary/detail/@item.ID">@item.Title</a>
                                                        </td>
                                                        <td class="titleright">
                                                            所需积分：@item.Charge<img src="/Content/images/money.png" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </li>
                                            <li>
                                                @{
                            string remark = Hangu.WebClient.MyHtmlHelper.FormatHtml(@item.Remark).ToHtmlString();
                            int len = remark.Length < 85 ? remark.Length : 85;
                                                }
                                                @remark.Substring(0, len)
                                                ...</li>
                                            <li><a href="/DownLoad/index/@HanGu.Common.RijndaelSecurity.EncryptDES(item.FilePath)" target="_blank">
                                                <img src="/Content/images/download.png" /></a></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div class="clearline" />
                        }
                    </div>
                    @Html.Partial("PageBar")
                </td>
            </tr>
        </table>
    </div>
}
@section Side{
    @Html.Partial("Side")
}
